{pyVersion, pyPkgs ? [], pkgs ? import <nixpkgs> {}}:

# E.g.  --arg pyVersion \"python36\" --arg pyPkgs '[ "requests" "tox" ]'

with pkgs;

(
  let
  py = builtins.getAttr pyVersion pkgs;

  in

  py.withPackages (ps: with ps; [
    setuptools
    pip
    wheel
    flake8
    pycodestyle
    coverage
    virtualenv
    virtualenvwrapper
  ] ++ map (x :builtins.getAttr x ps) pyPkgs)

).env
